{% extends "personnel/base.html" %}

{% block page_link %}
    <link rel="stylesheet" href="../../static/system_setup/css/style.css">
    <link rel="stylesheet" type="text/css" href="../../static/personal_center/css/index.css">
    <link rel="stylesheet" type="text/css" href="../../static/personal_center/css/common.css">
    <script type="text/javascript" src="../../static/personal_center/js/index.js"></script>
    <script type="text/javascript" src="../../static/public_file/js/ModalBox.js"></script>
{% endblock %}

{% block style %}
    <style>
        .add_class {
            background: #1E90FF;
        }
        .add_background {
            background: #A9A9A9;
        }

        .li-class {
            list-style: none;
            margin-top: 2%;
            color: #0b0b0b;
            cursor: pointer;
        }
        .shade {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(36, 36, 36, 0.5);
            display: none;
            z-index: 10000;
        }
        #addForm {
            width: 800px;
            height: 620px;
            background: #F5F5F5;
            position: absolute;
            border: #dfdfdf solid 1px;
            margin: auto;
            border-radius: 3px;
            top: 50%;
            left: 50%;
            /* 实现鼠标拖拽使用css3效果 */
            transform: translate(-50%, -50%);
            display: none;
            z-index: 10100;
            font-size: 0;
        }
        #title {
            display: flex;
            justify-content: space-between;
            box-sizing: border-box;
            padding: 0 10px;
            height: 50px;
            color: #0b0b0b;
            cursor: move;
            /*border: #dfdfdf solid 1px;*/
            width: 100%;background: #f4f7fa;border-top-left-radius: 5px;border-top-right-radius: 5px;
        }
        .search {
            width: 300px;
            display: flex;
            float: right;
            margin: 10px 0;
            margin-right: 1%;
            /*border: 1px solid red;*/
        }

        .search input {
            vertical-align: middle;
            float: left;
            flex: 4;
            height: 30px;
            width: 230px;
            outline: none;
            border: 1px solid #0070c1;
            box-sizing: border-box;
            border-bottom-left-radius: 3px;
            border-top-left-radius: 3px;
        }

        .search button {
            float: right;
            flex: 1;
            height: 30px;
            width: 70px;
            line-height: 30px;
            background-color: #0070c1;
            color: white;
            border-style: none;
            outline: none;
            border-bottom-right-radius: 3px;
            border-top-right-radius: 3px;
        }

        .search button i {
            font-style: normal;
        }

        .search button:hover {
            font-size: 16px;
        }
    </style>
{% endblock %}


{% block right_content %}
    <div id="new_models1" class="shade">
        <div id="add_personnel" style="position: absolute;width: 400px;height: 250px;top: 25%;left: 45%;box-shadow: 0 0 4px #999;background: white;border-radius: 3px;">
            <div id="box" style="width: 100%;height: 35px;border-bottom: #cfcfcf solid 1px;line-height: 35px;padding-left: 10px;cursor: move;">
                <p style="display: inline-block;">添加人员</p>
                <p onclick="close_model()" style="display: inline-block;float: right;cursor: pointer;width: 35px;height: 35px;line-height: 35px;text-align: center;">
                    <i class="iconfont icon-quchu"></i>
                </p>
            </div>

            <div style="width: 100%;height: 170px;border-bottom: #cfcfcf solid 1px;padding: 20px;">
                <div style="width: 100%;height: 40px;line-height: 40px;">
                    <label for="">选择人员：</label>
                    <input type="text" style="width: 250px;height: 30px;border: #cfcfcf solid 1px;border-radius: 3px;" onclick="fill_val()" id="conferee">
                </div>

                <div style="width: 100%;height: 40px;line-height: 40px;">
                    <label for="">选择班次：</label>
                    <select name="" id="duty_Shift" style="width: 250px;height: 30px;border: #cfcfcf solid 1px;border-radius: 3px;">
                        <option value="1">一线班</option>
                        <option value="2">二线班</option>
                    </select>
                </div>
            </div>

            <div style="width: 100%;height: 45px;text-align: right;padding-right: 10px;">
                <button onclick="sumit_val()" style="width: 70px;height: 29px;margin-top: 8px;border: #00a0e9 solid 1px;background: #00a0e9;color: white;border-radius: 3px;">提交</button>
            </div>
        </div>
    </div>

    <div id="remind" class="shade">
        <div id="del_remind" style="position: absolute;width: 400px;height: 250px;top: 25%;left: 45%;box-shadow: 0 0 4px #999;background: white;border-radius: 3px;">
            <div id="box_remind" style="width: 100%;height: 35px;border-bottom: #cfcfcf solid 1px;line-height: 35px;padding-left: 10px;cursor: move;">
                <p style="display: inline-block;"></p>
                <p onclick="close_remind()" style="display: inline-block;float: right;cursor: pointer;width: 35px;height: 35px;line-height: 35px;text-align: center;">
                    <i class="iconfont icon-quchu"></i>
                </p>
            </div>

            <div style="width: 100%;height: 170px;border-bottom: #cfcfcf solid 1px;padding: 20px;text-align: center;">
                <div style="width: 100%;height: 100px;line-height: 40px;">
                    <img src="../../static/personnel/img/jinggao.png" alt="" style="width: 100px;height: 100px;">
                </div>

                <div style="width: 100%;height: 40px;line-height: 40px;">
                    确认删除该值班人员！
                </div>
            </div>

            <div style="width: 100%;height: 45px;text-align: right;padding-right: 10px;">
                <button id="cancel-but" onclick="close_remind()" style="width: 70px;height: 29px;margin-top: 8px;border: #00a0e9 solid 1px;background: #00a0e9;color: white;border-radius: 3px;display: inline-block;vertical-align: top;">取消</button>
                <button id="remind-but" style="width: 70px;height: 29px;margin-top: 8px;border: red solid 1px;background: red;color: white;border-radius: 3px;display: inline-block;vertical-align: top;margin-left: 10px;">确认</button>
            </div>
        </div>
    </div>

    <div style="display: inline-block;vertical-align: top;width: 100%;height: 99%;margin-top: 5px;">
        <div class="headline">
            <button onclick="chose_line(this)" value="1" style="width: 70px;height: 28px;background: #00a0e9;border: #00a0e9 solid 1px;color: white;border-radius: 3px;display: inline-block;vertical-align: top;margin-left: 10px;margin-top: 3px;">一线班</button>
            <button onclick="chose_line(this)" value="2" style="width: 70px;height: 28px;background: #00a0e9;border: #00a0e9 solid 1px;color: white;border-radius: 3px;display: inline-block;vertical-align: top;margin-left: 5px;margin-top: 3px;">二线班</button>

            <div style="width: 600px;display: inline-block;vertical-align: top;margin-left: 5px;margin-top: 3px;">
                <div class="sa-ele" style="width: 50%;display: inline-block;vertical-align: top;">
                    <input class="se-con" name="user" placeholder="输入姓名" style="width: 100%;height: 30px;border-radius: 3px;border: #cfcfcf solid 1px;">
                </div>
                <div class="sa-ele" style="width: 15%;display: inline-block;vertical-align: top;">
                    <button class="search-action" style="width: 100%;height: 30px;border-radius: 3px;border: #cfcfcf solid 1px;">搜索
                    </button>
                </div>
            </div>

            <div style="width: 200px;float: right;padding-right: 30px;text-align: right;">
                <button onclick="add_people()" style="width: 100px;height: 28px;margin-top: 6px;border-radius: 3px;background: green;border: green solid 1px;color: white;">添加人员</button>
{#                <button onclick="fill_val()" style="width: 70px;height: 28px;margin-top: 6px;border-radius: 3px;background: green;border: green solid 1px;color: white;">添加人员</button>#}
            </div>
        </div>
        <div id="my_application" style="width: 100%;height: 95.3%;overflow: auto;background-color: white;">
            <div class="right-box" style="width: 100%;height: 100%;margin-top: 0;">
                <div style="height: 100%;width: 100%;overflow: auto;border-bottom: #cccccc solid 1px;background-color: white;">
                    <section class="grid-main" style="height: 100%;">
                        <table id="main_table"></table>
                    </section>
                </div>
            </div>
        </div>
    </div>

    <div id="addForm">
        <!-- 标题 -->
        <div id="title">
            <h5 style="line-height: 50px;width: 15%;margin-left: 1%;display: inline-block;font-size: 18px;">选择值班人员</h5>
            <div class="search" style="vertical-align: center;display: inline-block;text-align: right;margin-left: 35%;font-size: 14px;">
                <input type="text" placeholder="请输入..." name="" id="search_data" value="">
                <button id="search_button">搜索</button>
            </div>
            <span onclick="close_models1()" style="float: right;line-height: 50px;padding-right: 2%;cursor: pointer;"><i class="iconfont icon-quchu"></i></span>
        </div>
        <hr>
        <div style="display: inline-block;width: 30%;height: 350px;border-right: #E8E8E8 solid 1px;">
            <div style="width: 100%;height: 35px;line-height: 35px;padding-left: 2%;color: #0b0b0b;border-bottom: #cfcfcf solid 1px;font-size: 14px;">
                <div id="an_branch"
                     style="width: 31.5%;display: inline-block;cursor: pointer;text-align: center;color: #01aaed;">
                    按部门
                </div>
                <div id="an_rank"
                     style="width: 31.5%;display: inline-block;cursor: pointer;text-align: center;">按权限
                </div>
                <div id="an_func"
                     style="width: 31.5%;display: inline-block;cursor: pointer;text-align: center;">按职能
                </div>
            </div>
            <div id="department_list" style="width: 100%;height: 315px;overflow: auto;">
                <div style="width: 100%;height: 100%;text-align: center;">
                    <img style="width: 30%;height: 30%;margin-top: 35%;"
                         src="../../static/public_file/images/jiazai.gif" alt="">
                </div>
            </div>
        </div>

        <div style="display: inline-block;width: 69.5%;height: 350px;overflow: auto;vertical-align: top;left: 0;font-size: 14px;">
            <table class="table table-hover table-bordered"
                   style="border-collapse: collapse;margin: 0;padding: 0;">
                <thead>
                <tr>
                    <th scope="col" style="width: 10%;text-align: center;">
                        <input id="all_select_checkbox" type="checkbox">
                    </th>
                    <th scope="col" style="width: 20%;text-align: center;">序号</th>
                    <th scope="col" style="width: 35%;text-align: center;">姓名</th>
                    <th scope="col" style="width: 35%;text-align: center;">工号</th>
                </tr>
                </thead>
                <tbody style="overflow: auto;" id="t_table2"></tbody>
            </table>
            <div id="img-display1" style="width: 75%;text-align: center;">
                <div style="margin-top: 10%;">
                    <img src="../../static/public_file/images/page-img/11.jpg" alt="">
                    <p style="margin: 0;padding: 0;vertical-align: top;">暂无数据</p>
                </div>
            </div>
        </div>

        <div style="height: 150px;width: 100%;border-top: #E8E8E8 solid 1px;overflow: auto;">
            <div id="checked-label" style="margin-top: 1%;margin-left: 3%;width: 90%;font-size: 14px;">

            </div>
        </div>
        <hr>
        <div style="height: 70px;padding-right: 2%;font-size: 14px;">
            <button onclick="choose_people()" id="model-affirm" style="border-radius: 3px;height: 30px;float: right;margin-top: 15px;border: #1E90FF solid 1px;background: #1E90FF;color: white;">
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;提&nbsp;交&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </button>
        </div>
    </div>
{% endblock %}

{% block script %}
    <script>
        window.onload = function () {
            document.getElementById("loading").style.display = "none";
            document.getElementById("attendance").className = "add_class";
            document.getElementById("stuff_shift").className = "add-nav-active";
        };
        var data_value_temp = ''
        function select_all_option(tag) {
            var button_li = document.getElementsByClassName('checkbox_file');
            for (var i = 0; i < button_li.length; i++) {
                button_li[i].checked = "true";
            }
            console.log(button_li)
        }

        let title = document.querySelector("#box");
        let addForm = document.querySelector("#add_personnel");

        title.addEventListener("mousedown", function (e) {
            let x = e.pageX - addForm.offsetLeft;
            let y = e.pageY - addForm.offsetTop;

            document.addEventListener("mousemove", move);
            function move(e) {
                addForm.style.left = e.pageX - x + 'px';
                addForm.style.top = e.pageY - y + 'px';
            }

            document.addEventListener("mouseup", function (e) {
                document.removeEventListener("mousemove", move);
            })
        });

        let title1 = document.querySelector("#title");
        let addForm1 = document.querySelector("#addForm");
        title1.addEventListener("mousedown", function (e) {
            let x = e.pageX - addForm1.offsetLeft;
            let y = e.pageY - addForm1.offsetTop;


            document.addEventListener("mousemove", move);
            function move(e) {
                addForm1.style.left = e.pageX - x + 'px';
                addForm1.style.top = e.pageY - y + 'px';
            }

            document.addEventListener("mouseup", function (e) {
                document.removeEventListener("mousemove", move);
            })
        });

        let title2 = document.querySelector("#box_remind");
        let addForm2 = document.querySelector("#del_remind");
        title2.addEventListener("mousedown", function (e) {
            let x = e.pageX - addForm2.offsetLeft;
            let y = e.pageY - addForm2.offsetTop;


            document.addEventListener("mousemove", move);
            function move(e) {
                addForm2.style.left = e.pageX - x + 'px';
                addForm2.style.top = e.pageY - y + 'px';
            }

            document.addEventListener("mouseup", function (e) {
                document.removeEventListener("mousemove", move);
            })
        });

        const gridManagerName = "test",
            TYPE_MAP = {1: "HTML/CSS", 2: "nodeJS", 3: "javaScript", 4: "前端鸡汤", 5: "PM Coffee", 6: "前端框架", 7: "前端相关"},
            GM_PUBLISH_METHOD_MAP = {
                init: {key: "init", relyInit: !1, title: "初始化", code: 'demo1.initGM(document.querySelector("table"));'},
                get: {key: "get", relyInit: !0, title: "获取表格的实时配置信息", code: `GridManager.get('${gridManagerName}');`},
                version: {key: "version", relyInit: !1, title: "获取当前GridManager的版本号", code: "GridManager.version;"},
                getLocalStorage: {
                    key: "getLocalStorage",
                    relyInit: !0,
                    title: "获取表格用户记忆",
                    code: `GridManager.getLocalStorage('${gridManagerName}');`
                },
                resetLayout: {
                    key: "resetLayout",
                    relyInit: !0,
                    title: "重置表格布局",
                    code: `GridManager.resetLayout('${gridManagerName}', '800px', '500px');`
                },
                clear: {
                    key: "clear",
                    relyInit: !0,
                    title: "清除表格记忆数据",
                    code: `GridManager.clear('${gridManagerName}');`
                },
                getTableData: {
                    key: "getTableData",
                    relyInit: !0,
                    title: "获取指定tr所使用的数据",
                    code: `GridManager.getTableData('${gridManagerName}');`
                },
                getRowData: {
                    key: "getRowData",
                    relyInit: !0,
                    title: "获取指定tr所使用的数据",
                    code: `GridManager.getRowData('${gridManagerName}', document.querySelector("table[grid-manager=${gridManagerName}] tbody tr"));`
                },
                updateRowData: {
                    key: "updateRowData",
                    relyInit: !0,
                    title: "更新指定行所使用的数据",
                    code: `GridManager.updateRowData('${gridManagerName}', 'id', {id: 112, title: 'ccc'});`
                },
                updateTreeState: {
                    key: "updateTreeState",
                    relyInit: !0,
                    title: "更新树的展开状态",
                    code: `GridManager.updateTreeState('${gridManagerName}', true);`
                },
                setSort: {
                    key: "setSort",
                    relyInit: !0,
                    title: "手动设置排序",
                    code: `GridManager.setSort('${gridManagerName}', {createDate: 'ASC'});`
                },
                setConfigVisible: {
                    key: "setConfigVisible",
                    relyInit: !0,
                    title: "设置表头配置区域可视状态",
                    code: `GridManager.setConfigVisible('${gridManagerName}', true);`
                },
                setLineHeight: {
                    key: "setLineHeight",
                    relyInit: !0,
                    title: "配置行的高度",
                    code: `GridManager.setLineHeight('${gridManagerName}', '70px');`
                },
                showTh: {
                    key: "showTh",
                    relyInit: !0,
                    title: "设置列为可视状态",
                    code: `GridManager.showTh('${gridManagerName}', 'pic');`
                },
                hideTh: {
                    key: "hideTh",
                    relyInit: !0,
                    title: "设置列为隐藏状态",
                    code: `GridManager.hideTh('${gridManagerName}', 'pic');`
                },
                exportGrid: {
                    key: "exportGrid",
                    relyInit: !0,
                    title: "导出指定表格",
                    code: `GridManager.exportGrid('${gridManagerName}', 'demo中使用的导出').then(res=>{console.log('success')}).catch(err=>{console.error('error', err)});`
                },
                setQuery: {
                    key: "setQuery",
                    relyInit: !0,
                    title: "更改在生成组件时所配置的参数query",
                    code: `GridManager.setQuery('${gridManagerName}', {'userName':'baukh','sex':'男'});`
                },
                setAjaxData: {
                    key: "setAjaxData",
                    relyInit: !0,
                    title: "用于再次配置ajaxData数据",
                    code: `GridManager.setAjaxData('${gridManagerName}', {data: [{title: '通过setAjaxData动态添加的数据，其它项为空'}], totals: 1});`
                },
                refreshGrid: {
                    key: "refreshGrid",
                    relyInit: !0,
                    title: "刷新表格",
                    code: `GridManager.refreshGrid('${gridManagerName}');`
                },
                renderGrid: {
                    key: "renderGrid",
                    relyInit: !0,
                    title: "渲染表格",
                    code: `GridManager.renderGrid('${gridManagerName}');`
                },
                getCheckedTr: {
                    key: "getCheckedTr",
                    relyInit: !0,
                    title: "获取当前选中的行",
                    code: `GridManager.getCheckedTr('${gridManagerName}');`
                },
                getCheckedData: {
                    key: "getCheckedData",
                    relyInit: !0,
                    title: "获取选中行的渲染数据",
                    code: `GridManager.getCheckedData('${gridManagerName}');`
                },
                setCheckedData: {
                    key: "setCheckedData",
                    relyInit: !0,
                    title: "设置选中的数据",
                    code: `GridManager.setCheckedData('${gridManagerName}', [GridManager.getTableData('${gridManagerName}')[1]]);`
                },
                cleanData: {
                    key: "cleanData",
                    relyInit: !0,
                    title: "清除指定表格数据",
                    code: `GridManager.cleanData('${gridManagerName}');`
                },
                print: {key: "print", relyInit: !0, title: "打印当前页", code: `GridManager.print('${gridManagerName}');`},
                showRow: {
                    key: "showRow",
                    relyInit: !0,
                    title: "显示隐藏行",
                    code: `GridManager.showRow('${gridManagerName}', 1);`
                },
                hideRow: {
                    key: "hideRow",
                    relyInit: !0,
                    title: "隐藏行",
                    code: `GridManager.hideRow('${gridManagerName}', 1);`
                },
                showLoading: {
                    key: "showLoading",
                    relyInit: !0,
                    title: "显示加载中",
                    code: `GridManager.showLoading('${gridManagerName}');`
                },
                hideLoading: {
                    key: "hideLoading",
                    relyInit: !0,
                    title: "隐藏加载中",
                    code: `GridManager.hideLoading('${gridManagerName}', 300);`
                },
                destroy: {
                    key: "destroy",
                    relyInit: !0,
                    title: "消毁指定的GridManager实例",
                    code: `GridManager.destroy('${gridManagerName}');`
                }
            }, arg = {
                gridManagerName: "test",
                width: "100%",
                height: "100%",
                autoOrderConfig: {fixed: "left"},
                checkboxConfig: {key: "id", fixed: "left"},
                supportAjaxPage: !0,
                sortMode: "single",
                supportMenu: !0,
                menuHandler: e => (e.unshift({
                    content: "自定义菜单", line: !0, onClick: e => {
                        alert(e)
                    }
                }), e),
                useCellFocus: !0,
                useHideRow: !0,
                supportMoveRow: !0,
                moveRowConfig: {
                    key: "priority", useSingleMode: !0, fixed: "left", handler: (e, t) => {
                        console.log(e, t)
                    }
                },
                disableCache: !1,
                ajaxData: function (e, t) {
                    var local_host = window.location.host;          // 获取当前IP
                    return "/personnel/roster_setting"
                },
                exportConfig: {
                    fileName: e => {
                        const t = new Date;
                        let a = `${t.getFullYear()}-${t.getMonth() + 1}-${t.getDate()}`;
                        for (let t in e) a = `${a}-${t}=${e[t]}`;
                        return a
                    }, suffix: "xls"
                },
                ajaxType: "POST",
                checkedBefore: function (e, t, a) {
                    return console.log("checkedBefore==", e, t, a), a && 90 === a.id && alert("该节点在checkedBefore中配置为不可选"), a && 90 !== a.id
                },
                checkedAfter: function (e, t, a) {
                    console.log("checkedAfter==", e, t, a)
                },
                checkedAllBefore: function (e, t) {
                    console.log("checkedAllBefore==", e, t)
                },
                checkedAllAfter: function (e, t) {
                    console.log("checkedAllAfter==", e, t)

                },
                sortingBefore: function (e) {
                    console.log("sortingBefore", e)
                },
                sortingAfter: function (e) {
                    console.log("sortingAfter", e)
                },
                ajaxBeforeSend: function (e) {
                    console.log("ajaxBeforeSend")
                },
                ajaxSuccess: function (e) {
                    console.log("ajaxSuccess")
                },
                ajaxError: function (e) {
                    console.log("ajaxError")
                },
                ajaxComplete: function (e) {
                    console.log("ajaxComplete")
                },
                adjustBefore: e => {
                    console.log("adjustBefore=>", e)
                },
                adjustAfter: e => {
                    console.log("adjustAfter=>", e)
                },
                responseHandler: e => (e.data.forEach((e => {
                    e.priority = e.id
                })), e),
                rowRenderHandler: (e, t) => e,
                emptyTemplate: e => `<div style="text-align: center;">${e.query.title ? "搜索为空" : "暂无数据"}</div>`,
                columnData: [
                    {
                        key: "Shift",
                        text: "班次",
                        align: "center",
                        disableMoveRow: !0
                    }, {
                        key: "name",
                        text: "姓名",
                        align: "center",
                    }, {
                        key: "last_date",
                        text: "上次值班时间",
                        align: "center",
                    }, {
                        key: "shift_arrangement",
                        text: "值班类型",
                        align: "center",
                    }, {
                        key: "action",
                        width: "100px",
                        align: "center",
                        fixed: "right",
                        disableMoveRow: !0,
                        disableRowCheck: !0,
                        text: '<span style="color: red">操作</span>',
                        template: (e, t) => `<a class="plugin-action" id="${t.id}" onclick="remind_fuc('${t.id}')" href="#">删除</a>`
                    }]
            }, demo1 = {
                initSearch: function () {
                    document.querySelector(".search-action").addEventListener("click", (function () {
                        var e = {
                            search_value: document.querySelector('[name="user"]').value,
                        };
                        table.GM("setQuery", e, (function () {
                            console.log("setQuery执行成功````````````````", e)
                        }))

                    }))
                }, initFN: () => {

                }, initGM: function () {
                    new window.GridManager(table, arg, (e => {
                        console.log("渲染完成后的回调函数:", e), console.log(arg.columnData)
                    }))
                }, editRowData: function (e) {
                    window.GridManager.updateRowData("test", "id", {
                        id: window.parseInt(e.getAttribute("data-id")),
                        lastDate: (new Date).getTime()
                    })
                }
            }, table = document.querySelector("table");
        demo1.initSearch(table), demo1.initGM(table), demo1.initFN();

        function Judge_authority(ele_id, source) {
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/document-management/check_document_view", true);
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.send("source=" + source + "&id=" + ele_id);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate['code'] === 200) {
                            window.open(JsonDate['file_path'])
                        } else {
                            alert('该文件还未公开！')
                        }
                    }
                }
            };
        }

        function chose_line(eve) {
            var e = {
                line_type: eve.value,
                search_value: document.querySelector('[name="user"]').value,
            };
            table.GM("setQuery", e, (function () {
                console.log("setQuery执行成功````````````````", e)
            }))
        }

        // 添加值班人员
        function add_people() {
            document.getElementById("new_models1").style.display="table";
        }

        function close_model() {
            document.getElementById("new_models1").style.display="none";
        }

        function delete_people(prople_id) {
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/personnel/SchedulingDeleteView", true);
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.send("id=" + prople_id);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);

                        if (JsonDate['code'] === 200) {
                            alert("删除成功！");
                            document.getElementById("remind").style.display="none";
                            window.location.reload();
                        } else {
                            alert(JsonDate['message'])
                        }
                    }
                }
            };
        }

        function remind_fuc(ele_id) {
            document.getElementById("remind").style.display="table";
            document.getElementById("remind-but").setAttribute("onclick", "delete_people('"+ele_id+"')")
        }

        function close_remind() {
            document.getElementById("remind").style.display="none";
        }

        function sumit_val() {
            var duty_prople = document.getElementById("conferee").value;
            // 正则匹配工号
            var regex1 = /(?<=\()(.+?)(?=\))/g;
            var duty_list = duty_prople.match(regex1);              // 工号列表
            var myselect = document.getElementById("duty_Shift");
            var index = myselect.selectedIndex ;                  // selectedIndex代表的是你所选中项的index
            var duty_Shift = myselect.options[index].value;     // 选择班次

            if (duty_list.length === 0) {
                alert("请选择值班人员！");
                return false
            }
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/personnel/SchedulingView", true);
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.send("duty_list="+JSON.stringify(duty_list)+"&duty_Shift="+String(duty_Shift));
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);

                        if (JsonDate['code'] === 200) {
                            alert("创建成功！");
                            document.getElementById("new_models1").style.display="none";
                            window.location.reload();
                        } else {
                            alert(JsonDate['message'])
                        }
                    }
                }
            };
        }
    </script>
{% endblock %}